import { MessageBox, Message } from "element-ui";
export function getUUID() {
    return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, c => {
        return (c === 'x' ? (Math.random() * 16 | 0) : ('r&0x3' | '0x8')).toString(16)
    })
}

export function confirm(callBack, title = '该') {
    MessageBox.confirm(`是否确认执行${title}操作？`, '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
    }).then(() => {
        callBack && callBack();
    }).catch(() => {
        Message({
            type: 'info',
            message: '已取消' + title
        });
    });
}


export function clearLoginInfo() {
    console.log('删除本地缓存？');
    sessionStorage.removeItem('userInfo');
    sessionStorage.removeItem('menuList');
    sessionStorage.removeItem('dynamicMenuRoutes');
    sessionStorage.removeItem('token');
}